package com.lion.ball.modules.orderfood.service.assistants.converters;

import java.sql.Timestamp;
import com.lion.common.base.utils.ConvertUtil;
import com.lion.common.base.utils.DbUtil;
import com.lion.common.spring.annotations.DataConverter;
import com.lion.common.spring.business.base.BaseConverter;
import com.lion.utils.TimeUtil;
import com.lion.ball.modules.orderfood.domain.entity.OfdPackageFoodEntity;
import com.lion.ball.modules.orderfood.web.model.params.create.OfdPackageFoodCreateParam;
import com.lion.ball.modules.orderfood.web.model.params.update.OfdPackageFoodUpdateParam;
import com.lion.ball.modules.orderfood.web.model.results.OfdPackageFoodResult;

/**
 * @author Chris Chan
 * Create on 2025-10-18 13:33
 * Use for: 套餐与食品关联 业务数据转换助手
 * Explain:
 * 
 */
@DataConverter
public class OfdPackageFoodConverter implements BaseConverter<
        OfdPackageFoodEntity,
        OfdPackageFoodCreateParam,
        OfdPackageFoodUpdateParam,
        OfdPackageFoodResult> {
    @Override
    public OfdPackageFoodEntity fromParam(OfdPackageFoodCreateParam param) {
        OfdPackageFoodEntity entity = new OfdPackageFoodEntity();
        ConvertUtil.copyProperties(param, entity, "id");
        return entity;
    }

    @Override
    public OfdPackageFoodEntity fromUpdateParam(OfdPackageFoodUpdateParam param) {
        OfdPackageFoodEntity entity = ConvertUtil.convert(param, OfdPackageFoodEntity.class);
        return entity;
    }

    @Override
    public OfdPackageFoodResult toResult(OfdPackageFoodEntity entity) {
        OfdPackageFoodResult result = ConvertUtil.convert(entity,OfdPackageFoodResult.class);
        return result;
    }
}